#ifndef __packet_h__
#define __packet_h__ 1
#include "net.h"
#include "sys.h"
#include "log.h"
#include "vlan_hdr.h"
#include "ppp_hdr.h"
#include "dns_hdr.h"
#include "packet_util.h"

#define MAX_PACKET_LEN    0xffff

typedef struct _packet{
    char buf[MAX_PACKET_LEN];
    int len, data_len;
    struct ethhdr *eth_hdr;
    struct vlanhdr *vlan_hdr;
    struct ppphdr *ppp_hdr;
    struct iphdr *ip_hdr;
    struct icmp *icmp_hdr;
    struct tcphdr *tcp_hdr;
    struct udphdr *udp_hdr;
    char *data;
}Packet_t;


extern Packet_t *packet_new();
extern void packet_reset(Packet_t *packet);
extern void packet_free(Packet_t *packet);
#endif